
*Set your own working directory
cd 

use 1data_replicate.dta,clear

*Main results
**********Table 1**********
preserve

label variable loggdp "County GDP (10,000 RMB, logged)"
label variable logpop "Population (10,000, logged)"
label variable logarea "Administrative area (logged)"
label variable logdis_province "Distance to province capital (logged)"
label variable logdis_airport "Distance to nearest airpot (logged)"

estpost tabstat general_living lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county if _d!=. ,statistics(count mean sd min max) columns(statistics)

esttab . using table.A1.txt, cells("count(label(Obs)) mean(label(Mean) fmt(3)) sd(label(SD) fmt(3)) min(label(Min)) max(label(Max))") replace noobs label booktabs nonum nomtitles

restore

**********Table 2**********
eststo clear
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness
stcox general_living          , robust nohr strata(prefectureid)
estadd local covariates_eco "No"
estadd local covariates_pol "No"
estadd local prefecturefe "Yes"
est store m1
stcox general_living $control , robust nohr strata(prefectureid)
estadd local covariates_eco "Yes"
estadd local covariates_pol "No"
estadd local prefecturefe "Yes"
est store m2
stcox general_living $control leader_incumbent connect_pro_prefecture connect_prefecture_county, robust nohr strata(prefectureid)
estadd local covariates_eco "Yes"
estadd local covariates_pol "Yes"
estadd local prefecturefe "Yes"
est store m3

*screen
esttab m1 m2 m3, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living) order(general_living) stats(covariates_eco covariates_pol prefecturefe N N_sub N_fail r2_p, labels("Socioeconomic covariates" "Political connection covariates" "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 0 3)) nogap nomtitles

*output
esttab m1 m2 m3 using table1.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living) order(general_living) stats(covariates_eco covariates_pol prefecturefe N N_sub N_fail r2_p, labels("Socioeconomic covariates" "Political connection covariates" "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 0 3)) nogap nomtitles mgroup("Time to 1st HSR Station", pattern(1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

**********Table 3 (part)**********
preserve
recode general_living (1/13=1),gen(general_living_dummy)
label variable general_living_dummy "No. of living generals (dummy)"

eststo clear
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_prefecture_county
stcox general_living                if general_all!=0 , robust nohr strata(prefectureid)
estadd local covariates "No"
estadd local prefecturefe "Yes"
estadd local ipw "No"
est store m1

stcox general_living $control       if general_all!=0 , robust nohr strata(prefectureid)
estadd local covariates "Yes"
estadd local prefecturefe "Yes"
estadd local ipw "No"
est store m2

stcox general_living_dummy          if general_all!=0 , robust nohr strata(prefectureid)
estadd local covariates "No"
estadd local prefecturefe "Yes"
estadd local ipw "No"
est store m3

stcox general_living_dummy $control if general_all!=0 , robust nohr strata(prefectureid)
estadd local covariates "Yes"
estadd local prefecturefe "Yes"
estadd local ipw "No"
est store m4

*screen
esttab m1 m2 m3 m4, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living general_living_dummy) order(general_living general_living_dummy) stats(covariates prefecturefe N N_sub N_fail r2_p, labels("Covariates" "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 3)) nogap nomtitles

*output
esttab m1 m2 m3 m4 using table2.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living general_living_dummy) order(general_living general_living_dummy) stats(covariates prefecturefe N N_sub N_fail r2_p, labels("Covariates" "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 3)) nogap nomtitles mgroup("Time to 1st HSR Station", pattern(1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))
 
restore

**********Figure 4**********
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county

eststo clear
stcox general_living general_deceased $control , robust nohr strata(prefectureid)

*coefplot
coefplot,vertical keep(general_living general_deceased) grid(none) yline(0, lpattern(shortdash)) scheme(s1mono) mcolor(black) ciopts(lcolor(black)) l1title(Coefficients) coeflabels(general_living = "No. of living generals{it:{subscript:t-1}}" general_deceased = "No. of deceased generals{it:{subscript:t-1}}") levels(95 90) xsize(5) ysize(4) ylabel(0 "0" 0.2 "0.2" 0.4 "0.4" 0.6 "0.6" 0.8 "0.8",angle(horizontal))
graph export figure4.pdf, replace

********************

**********Table 4**********
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county
eststo clear
stcox cc_incumbent $control , robust nohr strata(prefectureid)
estadd local covariates "Yes"
estadd local prefecturefe "Yes"
est store m1
stcox general_living cc_incumbent $control , robust nohr strata(prefectureid)
estadd local covariates "Yes"
estadd local prefecturefe "Yes"
est store m2
stcox c.general_living##c.cc_incumbent $control , robust nohr strata(prefectureid)
estadd local covariates "Yes"
estadd local prefecturefe "Yes"
est store m3
stcox cc_retired $control , robust nohr strata(prefectureid)
estadd local covariates "Yes"
estadd local prefecturefe "Yes"
est store m4
stcox general_living cc_retired $control , robust nohr strata(prefectureid)
estadd local covariates "Yes"
estadd local prefecturefe "Yes"
est store m5
stcox c.general_living##c.cc_retired $control , robust nohr strata(prefectureid)
estadd local covariates "Yes"
estadd local prefecturefe "Yes"
est store m6

*screen
esttab m1 m2 m3 m4 m5 m6, b(3) se(3) nonote nobaselevels replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living cc_incumbent c.general_living#c.cc_incumbent cc_retired c.general_living#c.cc_retired) order(general_living cc_incumbent c.general_living#c.cc_incumbent cc_retired c.general_living#c.cc_retired) stats(covariates prefecturefe N N_sub N_fail r2_p, labels("Covariates"  "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 3)) nogap nomtitles

*output
esttab m1 m2 m3 m4 m5 m6 using table2.txt, booktabs label b(3) se(3) nonote nobaselevels replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living cc_incumbent c.general_living#c.cc_incumbent cc_retired c.general_living#c.cc_retired) order(general_living cc_incumbent c.general_living#c.cc_incumbent cc_retired c.general_living#c.cc_retired) stats(covariates prefecturefe N N_sub N_fail r2_p, labels("Covariates"  "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 3)) nogap nomtitles

********************

*Appendix
**********Table.A1**********
preserve

label variable loggdp "County GDP (10,000 RMB, logged)"
label variable logpop "Population (10,000, logged)"
label variable logarea "Administrative area (logged)"
label variable logdis_province "Distance to province capital (logged)"
label variable logdis_airport "Distance to nearest airpot (logged)"

estpost tabstat general_living lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county general_deceased general_beijing general_else cc_incumbent cc_retired if _d!=. ,statistics(count mean sd min max) columns(statistics)

esttab . using table.A1.txt, cells("count(label(Obs)) mean(label(Mean) fmt(3)) sd(label(SD) fmt(3)) min(label(Min)) max(label(Max))") replace noobs label booktabs nonum nomtitles

restore

********************

**********Table.A2**********
eststo clear
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness
stcox general_living          , robust nohr
estadd local prefecturefe "No"
est store m1
stcox general_living          , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m2
stcox general_living $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m3
stcox general_living $control leader_incumbent connect_pro_prefecture connect_prefecture_county, robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m4

*screen
esttab m1 m2 m3 m4, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) order(general_living) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles

*output
esttab m1 m2 m3 m4 using table.A2.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) order(general_living) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles mgroup("Time to 1st HSR Station", pattern(1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

*Robustness
**********Table.A3**********
preserve

global time time
global event station_additional

stset $time, failure($event) id(countyid)

global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county
eststo clear
stcox general_living          , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m1
stcox general_living $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living)

*output
esttab m1 m2 using robust1.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

restore

********************

**********Table.A4**********

eststo clear
stcox lag_general_living if lag_loggdp!=., robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m1
stcox lag_general_living lcp lag_loggdp lag_logpop logarea logdis_province train2004 logdis_airport ruggedness lag_leader_incumbent connect_pro_prefecture connect_prefecture_county, robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(lag_general_living) 

label variable lag_general_living "No. of living generals"
label variable lag_loggdp "County GDP"
label variable lag_logpop "Population"
label variable lag_leader_incumbent "Hometowns of incumbent leaders"

*output
esttab m1 m2 using robust2.txt, booktabs label b(3) se(3) nonote nobaselevels replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(lag_general_living) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

**********Table.A5**********
global control lcp lognightlight logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county

eststo clear
stcox general_living lognightlight if lognightlight!=., robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m1
stcox general_living $control, robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living)

*output
esttab m1 m2 using robust3.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

**********Table.A6**********
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport leader_incumbent connect_pro_prefecture connect_prefecture_county

eststo clear
stcox general_living         plain, robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m1
stcox general_living $control plain, robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living)

*output
esttab m1 m2 using robust4.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

**********Table.A7**********
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county 
eststo clear
stcox general_living connect_pro_county         , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m1
stcox general_living connect_pro_county $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living)

*output
esttab m1 m2 using robust5.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

**********Table.A8**********
global control leastdistance loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county 
eststo clear
stcox general_living leastdistance         , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m1
stcox general_living $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living)

*output
esttab m1 m2 using robust6.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************


**********Table.A9**********
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county

eststo clear
stcox general_living          if population>=50, robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m1
stcox general_living $control if population>=50, robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living)

*output
esttab m1 m2 using robust7.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

**********Table.A10**********
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county

eststo clear
stcox general_living          if provinceid!=15, robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m1
stcox general_living $control if provinceid!=15, robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living)

*output
esttab m1 m2 using robust8.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

**********Table.A11**********

global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county

eststo clear
stcox general_living_leader          , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m1
stcox general_living_leader $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living_leader)

label variable general_living_leader "No. of living generals"
*output
esttab m1 m2 using robust9.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living_leader) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

**********Figure.A7**********

*prepare for ggplot2 in R
preserve
mat resultall=J(10,2,.)
forvalues i = 1(1)10 {
capture drop generaldummy
gen generaldummy=0
replace generaldummy=1 if general_living>=`i'
quietly:stcox generaldummy $control, robust nohr strata(prefectureid)
mat result = r(table)
mat resultall[`i',1]=result[1,1]
mat resultall[`i',2]=result[2,1]
}

clear
svmat resultall
rename resultall1 b
rename resultall2 se
save Coefficients1.dta,replace

restore

**********Table.A12**********

preserve

gen stationlogit=_d
replace stationlogit=1 if stationlogit==.
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county

eststo clear
logit stationlogit general_living          i.prefectureid if _d!=. ,vce(cluster countyid)
estadd local prefecturefe "Yes"
est store m1
logit stationlogit general_living $control i.prefectureid if _d!=. ,vce(cluster countyid)
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) drop(*.prefectureid) stats( prefecturefe N r2_p, labels("Prefecture fixed effect" "Observations" "pseudo-R-squared") fmt(0 0 3)) nogap nomtitles order(general_living) eqlabels(none)

*output
esttab m1 m2 using robust11.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) drop(*.prefectureid) stats(prefecturefe N r2_p, labels("Prefecture fixed effect" "Observations" "pseudo-R-squared") fmt(0 0 3)) nogap nomtitles order(general_living) eqlabels(none)

restore

********************

**********Table.A13**********
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county

eststo clear
vcemway stcox general_living          , cluster(countyid lineid) nohr
est store m1
vcemway stcox general_living $control , cluster(countyid lineid) nohr 
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats( N N_sub N_fail r2_p, labels("Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living)
*output
esttab m1 m2 using robust12.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(N N_sub N_fail r2_p, labels("Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 3)) nogap nomtitles order(general_living) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

**********Table.A14**********
preserve

gen station2015=_d
replace station2015=1 if _d==.
bysort countyid: egen general_living2003=max(general_living)

label variable general_living2003 "No. of living generals in 2003"

eststo clear
reg station2015 general_living2003 i.prefectureid if year==2015
estadd local prefecturefe "Yes"
est store m1
reg station2015 general_living2003 lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county i.prefectureid if year==2015
estadd local prefecturefe "Yes"
est store m2

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N r2_a, labels("Prefecture fixed effect" "Observations"  "Adjust-R-squared") fmt(0 0 3)) nogap nomtitles order(general_living2003) drop(*.prefectureid)
*output
esttab m1 m2 using robust13.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N r2_a, labels("Prefecture fixed effect" "Observations"  "Adjust-R-squared") fmt(0 0 3)) nogap nomtitles order(general_living2003) drop(*.prefectureid)

restore

********************

**********Table.A15**********
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county 

eststo clear
eststo m1:stcox general_living revolutionaryarea         , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
eststo m2:stcox general_living revolutionaryarea $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"

*screen
esttab m1 m2, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living)

*output
esttab m1 m2 using table.A15.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) stats(prefecturefe N N_sub N_fail r2_p, labels("Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 3)) nogap nomtitles order(general_living) mgroup("Time to 1st HSR Station", pattern(1 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

********************

**********Table.A16**********
eststo clear
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county
stcox general_living                  $control, robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m1
stcox general_deceased                $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m2
stcox general_living general_deceased $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m3

*screen
esttab m1 m2 m3, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living general_deceased)   stats(control prefecturefe N N_sub N_fail r2_p, labels("Covariates" "Strata: prefecture"  "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 3)) nogap nomtitles

*output
esttab m1 m2 m3 using table.A16.txt, booktabs b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(general_living general_deceased) nonote nobaselevels label replace noconstant nodepvars stats(control prefecturefe N N_sub N_fail r2_p, labels("Covariates" "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 3)) nogap mgroup("Time to 1st HSR Station", pattern(1 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) nomtitles
********************

**********Table.A17**********
global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county

eststo clear

stcox cc_mility_incumbent $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m1
stcox general_living cc_mility_incumbent $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m2
stcox c.general_living##c.cc_mility_incumbent $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m3
stcox mility_retired $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m4
stcox general_living mility_retired $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m5
stcox c.general_living##c.mility_retired $control , robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m6

*screen
esttab m1 m2 m3 m4 m5 m6, b(3) se(3) nonote nobaselevels replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living cc_mility_incumbent c.general_living#c.cc_mility_incumbent mility_retired c.general_living#c.mility_retired) order(general_living cc_mility_incumbent c.general_living#c.cc_mility_incumbent mility_retired c.general_living#c.mility_retired) stats(control prefecturefe N N_sub N_fail r2_p, labels("Covariates"  "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 3)) nogap nomtitles

*output
esttab m1 m2 m3 m4 m5 m6 using table.A17.txt, booktabs label b(3) se(3) nonote nobaselevels replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living cc_mility_incumbent c.general_living#c.cc_mility_incumbent mility_retired c.general_living#c.mility_retired) order(general_living cc_mility_incumbent c.general_living#c.cc_mility_incumbent mility_retired c.general_living#c.mility_retired) stats(control prefecturefe N N_sub N_fail r2_p, labels("Covariates"  "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 3)) nogap nomtitles

********************

**********Table.A18**********
eststo clear

global control lcp loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness leader_incumbent connect_pro_prefecture connect_prefecture_county

stcox general_beijing  $control ,robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m1
stcox general_else $control ,robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m2
stcox general_beijing general_else $control ,robust nohr strata(prefectureid)
estadd local prefecturefe "Yes"
estadd local control "Yes"
est store m3

*screen
esttab m1 m2 m3 , b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(general_beijing general_else) order(general_beijing general_else) nonote nobaselevels label replace noconstant nodepvars stats(control prefecturefe N N_sub N_fail r2_p, labels("Covariates" "Strata: prefecture"  "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 3)) nogap nomtitles

*output
esttab m1 m2 m3 using table.A18.txt, booktabs label b(3) se(3) star(* 0.10 ** 0.05 *** 0.01) keep(general_beijing general_else) order(general_beijing general_else)nonote nobaselevels replace noconstant nodepvars stats(control prefecturefe N N_sub N_fail r2_p, labels("Covariates" "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 3)) nogap nomtitles

********************

**********Table.A19**********

preserve

global time time
global event station_prefecture_proposal

* Set data as survival time
stset $time, failure($event) id(countyid)
sort countyid year

eststo clear
global control leastdistance loggdp logpop logarea logdis_province train2004 logdis_airport ruggedness
stcox general_living          , robust nohr
estadd local control_eco "No"
estadd local control_pol "No"
estadd local prefecturefe "Yes"
est store m1
stcox general_living $control , robust nohr
estadd local control_eco "Yes"
estadd local control_pol "No"
estadd local prefecturefe "Yes"
est store m2
stcox general_living $control leader_incumbent connect_pro_prefecture connect_prefecture_county, robust nohr
estadd local control_eco "Yes"
estadd local control_pol "Yes"
estadd local prefecturefe "Yes"
est store m3

*screen
esttab m1 m2 m3, b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living ) ///
order(general_living ) ///
stats(control_eco control_pol prefecturefe N N_sub N_fail r2_p, labels("Socioeconomic controls" "Political connection controls" "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 0 3)) nogap nomtitles

*output
esttab m1 m2 m3 using table.A19.txt, booktabs b(3) se(3) nonote nobaselevels label replace noconstant nodepvars star(* 0.10 ** 0.05 *** 0.01) keep(general_living ) ///
order(general_living ) ///
stats(control_eco control_pol prefecturefe N N_sub N_fail r2_p, labels("Socioeconomic controls" "Political connection controls" "Strata: prefecture" "Observations" "No. of counties" "No. of counties have HSR stations" "pseudo-R-squared") fmt(0 0 0 0 0 0 3)) nogap nomtitles mgroup("Time to 1st HSR Station", pattern(1 0 0 0) prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span}))

restore

**********Table.A20**********

preserve

label variable general_living_leader "No. of living without govt positions"
label variable cc_incumbent "No. of incumbent CC members (2004-15, minus military)"
label variable cc_mility_incumbent "No. of military CC members (2004-15)"
label variable cc_retired "No. of retired CC members"
label variable lognightlight "Night light (logged)"

estpost tabstat general_beijing general_else general_living_leader cc_incumbent cc_mility_incumbent cc_retired lognightlight plain revolutionaryarea connect_pro_county leastdistance if _d!=. ,statistics(count mean sd min max) columns(statistics)

esttab . using table.A20.txt, cells("count(label(Obs)) mean(label(Mean) fmt(3)) sd(label(SD) fmt(3)) min(label(Min)) max(label(Max))") replace noobs label booktabs nonum nomtitles

restore

********************